﻿Imports PadovadoAPI
Imports System.Data

Partial Class AdminAggiungiUtente
    Inherits System.Web.UI.Page
    Protected Sub BtnUser_Click(sender As Object, e As System.EventArgs) Handles BtnUser.Click
        Dim ImgUrl As String = ""

        Select Case DDLMeteo.SelectedValue
            Case 1
                ImgUrl = "~/Styles/Images/Meteo/Sole.jpg"
            Case 2
                ImgUrl = "~/Styles/Images/Meteo/Variabile.jpg"
            Case 3
                ImgUrl = "~/Styles/Images/Meteo/Pioggia.jpg"
            Case 4
                ImgUrl = "~/Styles/Images/Meteo/PioggiaIntensa.jpg"
            Case 5
                ImgUrl = "~/Styles/Images/Meteo/temporale.jpg"
            Case 6
                ImgUrl = "~/Styles/Images/Meteo/Nebbia.jpg"
            Case 7
                ImgUrl = "~/Styles/Images/Meteo/Neve.jpg"
            Case 8
                ImgUrl = "~/Styles/Images/Meteo/Nuvoloso.jpg"


        End Select
        Dim sql As String = "INSERT INTO Meteo(DataRiferimento, ImgMeteo, TMax, Tmin) VALUES('" & _
            Calendar1.SelectedDate.Date.ToString("yyyyMMdd") & "', '" & ImgUrl & "','" & TBTMAx.Text & "','" & TBMin.Text & "')"
        Dim dbo As New DBObject
        dbo.ExecuteNonQuery(sql, Nothing, CommandType.Text)

    End Sub
End Class
